<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
      .red {
          color: red;
      }

      .font {
          font-size: 18px;
      }

      .bgc {
          background-color:gold;
      }
  </style>
</head>
<body>
  <div id="app">
     <h1 :class="{'red':isFlag,'font':!isFlag}" @click='changeStyle'> v-bind so easy!</h1>
     <hr>
     <h1 :class=['red','font','bgc']>v-bind is not so hard!</h1>
     <hr>
     <h1 :class=['red',{'flag':!isFlag},{'bgc':isFlag}]></h1>
  </div>
  <script src="./vue.js"></script>
  <script>
    var vm = new Vue({
      el:'#app',
      data:{
          varRed: true,
          varFont: true,
          isFlag:true
      },
      methods:{
          changeStyle() {
              this.isFlag = this.isFlag ? false : true
          }
      }
     });
  </script>
</body>
</html>
